<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <link rel="stylesheet"  th:href="@{/css/file.css}" />
    <link rel="stylesheet"  th:href="@{/css/bootstrap.css}" />
    <link th:href="@{/css/semantic.min.css}" rel="stylesheet">
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/js/bootstrap-paginator.js}"></script>
    <script th:src="@{/js/semantic.min.js}"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<!--管理界面-->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <a class="layui-btn" href="" ><i class="layui-icon layui-icon-refresh-3"></i> 刷新</a>
                </div>
                <!--                列表-->
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>试卷名称</th>
                            <th>学生姓名</th>
                            <th>班级</th>
                            <th>状态</th>
                            <th>操作</th>
<!--                            <th>操作</th>-->
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="result:${results}">
                            <td th:each="exam:${exams}" th:if="${exam.getId()==result.getExam_id()}" th:text="${exam.getName()}"></td>
                            <td th:text="${result.getStu_name()}"></td>
                            <td th:each="class:${Allclass}" th:if="${class.getId()==result.getClass_id()}" th:text="${class.getClass_name()}"></td>
                            <td th:text="${result.getStatus()==0?'未批改':'已批改'}"></td>
                            <td>
                                <button class="ui primary button" th:if="${result.getStatus()==0}" th:onclick="|correcting(${result.getId()})|">批改</button>
                                <button class="ui  button" th:if="${result.getStatus()==1}"  disabled>已批改</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <!--使用bootstrop-paginot实现分页-->
                    <!--                    <ul id="pagination"></ul>-->
                </div>
                <!--                列表-->
            </div>
        </div>
    </div>
</div>
<!--管理界面-->

</body>
<script>
    //进行批改操作
    function correcting(exam_id) {
        layer.open({
            type: 2,
            title: '作业批改中',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area : ['800px' , '520px'],
            content: '/tea/exam/correcting/papers?exam_id=' + exam_id
        });
    }
</script>
</html>